<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>福利直播(实时线报)</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="msapplication-tap-highlight" content="no">
    <meta name="format-detection" content="telephone=no">

    <link href="https://cdn.jsdelivr.net/gh/clin003/cdn/openapi_weblive/live/static/css/style.css" rel="stylesheet">
</head>

<body>
    <section style="margin-bottom: 60px;">
        <header class="mint-header is-fixed" style="background-color: rgb(4, 11, 30);">
            <div class="mint-header-button is-left"></div>
            <h1 class="mint-header-title">慧林直播(实时线报)</h1>
            <div class="mint-header-button is-right"></div>
        </header>

        <div style="height: 40px;"></div>
        <div class="container" id="container">
            <div class="chat-list form-control">
                <ul v-for="item in msgList" style="width: 100%;">
                    <div style="margin-left: 10px;"><span style="vertical-align: text-top;"><svg viewBox="0 0 1024 1024"
                                version="1.1" xmlns="//www.w3.org/2000/svg" p-id="5165" width="32" height="32"
                                class="icon">
                                <path
                                    d="M492.49 372.91l26.73 24.47-13.36 14.46H678.4l0.55 40.06-107.4 0.55v51.75l106.27 1.68v26.15H572.09l-0.55 93.48c35.61 1.1 47.29-13.91 47.29-13.91l-12.24-24.5 63.98-37.28 33.93 75.67V397.88c-40.61-104.62-212.05-25.05-212.05-25.05l0.04 0.08zM511.99 64C264.58 64 64 264.61 64 512.01S264.58 960 511.99 960C759.42 960 960 759.42 960 512.01S759.42 64 511.99 64zM288.28 276.57c29.5 0 53.42 23.92 53.42 53.42s-23.92 53.42-53.42 53.42-53.42-23.92-53.42-53.42 23.92-53.42 53.42-53.42z m54.52 298.3l-77.92 160.27-83.48-53.42 110.2-120.21c15.56-20.04 0-44.52 0-44.52l-81.25-70.11 35.63-48.97s38.96 30.05 81.8 72.34 15.02 104.62 15.02 104.62z m459.7 80.12s-6.68 94.61-99.04 92.39-92.41 0-92.41 0l-26.73 0.03s-15.56-21.72 0.58-54c0 0 33.93-5.58 39.48 13.36h38.96s37.83-7.23 40.61-66.79l-53.42 40.06-19.47-39.51s-70.69 56.75-128.57 52.87h-78.47s-51.2-13.34-53.97-80.7v-52.33h80.15s-8.36 82.38 38.96 78.47l1.1-105.75H370.05v-26.73h120.21l-0.55-52.87-17.27-0.55-48.97 48.42-32.28-28.93 60.65-60.11-1.68-27.28-76.24 70.11-46.19-46.19s61.21-39.51 81.25-132.45l68.44 17.27-11.11 36.16s298.27-109.07 336.13 81.25v243.75l0.06 0.05z"
                                    fill="#FF5500" p-id="5166"></path>
                            </svg></span>
                        <span style="color: rgb(136, 136, 136); font-size: xx-small;">慧林直播</span>
                    </div>
                    <div class="message-box">
                        <p v-html="item.text.contentExPic">
                        </p>
                        <label class="btn" :data-clipboard-text="item.text.content" data-clipboard-action="copy"
                            @click="copyMessage($event,item.text.content)">
                            <p style="margin-top: 8px;font-size:medium;" v-html="item.text.contentEx"><span></span>
                            </p>
                            <p style="color: rgb(136, 136, 136);font-size: xx-small;text-align:right">{{item.msgTime}}
                            </p>
                        </label>
                    </div>
                </ul>
            </div>
            <div class="scollTop" id="imgscoll" v-show="isShowimg === true"
                style="position: fixed;bottom: 10rem;right: 0rem;">
                <img src="https://img.alicdn.com/imgextra/i4/2092613237/O1CN011W1OCG1Zmag0SN6NI_!!2092613237.png" alt
                    @click="goTop" style="width: 5rem;height: 5rem;">
            </div>
        </div>
    </section>

    <div class="home_page_tab">
        <div class="per_home_tab cur_tab_active">
            <a href="https://beta.lyhuilin.com">
                <div><svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="//www.w3.org/2000/svg" p-id="7543"
                        width="32" height="32">
                        <path
                            d="M971.747 356.268c-0.705-1.624-1.487-3.225-2.386-4.711L841.785 137.93l-99.853 218.377h229.815v-0.04z m-631.255 0H681.32L510.866 115.604 340.492 356.268z m135.375-251.34H235.281c-9.384 0-19.512 3.38-28.134 8.877l103.018 225.14L475.867 104.93z m339.969 6.08c-7.39-3.85-15.561-6.12-23.266-6.12H545.864l165.744 234.018 104.228-227.899zM330.793 390.972L510.36 945.64c0.466 0.062 0.858 0.1 1.288 0.14l179.331-554.807H330.793v-0.001zM182.569 143.7L58.453 351.557c-0.956 1.603-1.875 3.185-2.795 4.711H279.8L182.569 143.7zM51.512 390.973l0.997 1.72h1.839c2.091 2.561 4.907 6.062 8.349 10.324l394.186 490.208L294.23 390.973H51.512z m920.976 0H727.54L560.802 906.695 965.84 403.017c2.855-3.558 5.044-7.665 6.648-12.044z m0 0"
                            fill="#ED710D" p-id="7544"></path>
                    </svg></div>
                <div style="margin-top: -5px;font-size:medium;font-size: 13px;">实时线报</div>
            </a>
        </div>
        <div class="per_home_tab">
            <a
                href="https://temai.m.taobao.com/index.htm?pid=mm_13141377_39162885_111708700203&union_lens=lensId%3APUB%401633872363%400b19bc93_8d53_17c6a61bf05_03f3%4001">
                <div><svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="//www.w3.org/2000/svg" p-id="2947"
                        width="32" height="32">
                        <path
                            d="M298.995428 608.655715c20.555868-63.551296 24.90505-112.00271-9.930893-146.9453C244.103912 416.612362 239.231892 412.430523 172.424345 362.897016L124.699096 436.578628 213.123793 491.619712s58.834913 30.191092 30.893846 86.610805C217.485981 631.754242 88.873836 748.85094 88.873836 748.85094l115.426736 71.992142c79.63009-173.082879 74.582923-149.95834 94.694856-212.187367zM469.08044 269.548708c18.238645-31.727526 27.052329-52.400014 27.052329-52.400014l-106.457416-29.877649s-42.959011 140.143201-119.531407 205.537002c0 0 74.062686 42.750483 73.191289 41.497579a746.417531 746.417531 0 0 0 57.003244-63.791472Q425.72735 359.397121 449.662591 349.603658c-19.631146 35.469331-51.532085 88.561693-83.333311 122.073632l44.843137 39.225877s30.539218-29.306689 63.945808-64.791194h38.094361v65.385131H364.646747v52.327181H513.213887v125.394479c-1.868518-0.0737-3.754378-0.091041-5.605555-0.208095-16.41348-0.836715-41.935445-3.563624-51.910991-19.279119-12.147536-19.153395-3.264488-54.464488-2.622862-76.019645H350.729104l-3.749175 1.872854s-37.370364 168.188315 108.335905 164.433937c136.479865 3.702354 214.662828-37.951296 252.167587-66.84613l14.939475 55.639356 84.157019-34.912244-56.840237-139.562269-68.411177 21.24735 12.832515 47.866147c-17.631702 13.014598-37.916613 22.838408-59.536799 30.048027v-109.678984h144.851346v-52.32718h-144.851346v-65.380796h145.449619V393.795631h-258.453785c18.594141-22.607336 33.234479-43.371732 37.123251-56.66986l-44.952819-12.182218c193.138019-69.178527 300.827096-57.269433 299.790956 56.072454v298.981554s11.57094 102.777172-106.12403 95.31177l-63.481931-13.6779-14.952481 60.38652s274.555123 78.464759 296.981677-132.699475c22.435224-211.155563-5.605555-345.697544-5.605555-345.697545S895.588146 148.714974 469.08044 269.548708z m-157.585883-2.331529c0-37.630483-34.017003-68.151058-75.972389-68.151059-41.942815 0-75.964586 30.520576-75.964586 68.151059 0.004335 37.66083 34.021771 68.14759 75.964586 68.14759 41.955387 0 75.97239-30.48676 75.972389-68.14759z"
                            fill="#8a8a8a" p-id="2948"></path>
                    </svg></div>
                <div style="margin-top: -5px;font-size:medium;font-size: 13px;">专享优惠券</div>
            </a>
        </div>
        <div class="per_home_tab">
            <a href="https://jingfen.jd.com/item?u_act_p=union-activity&union_page_id=28439&utm_campaign=t_1000236863">
                <div><svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="//www.w3.org/2000/svg" p-id="4922"
                        width="32" height="32">
                        <path
                            d="M187.847 380.7c1.593 20.594 3.869 41.302 4.665 62.01 1.48 38.456-13.767 69.062-45.056 91.477-24.12 17.294-50.517 29.81-79.303 36.636-33.678 7.85-61.781-19.797-53.02-53.362 5.006-19.114 11.377-38.57 21.39-55.41 24.803-41.756 39.936-86.926 52.337-133.347 2.276-8.647 5.348-17.294 9.216-25.372 6.713-13.995 22.073-21.277 36.75-16.84 10.582 3.186 20.936 7.737 30.834 12.971 15.702 8.192 30.948 17.522 46.422 26.397 9.443-10.127 18.546-20.822 28.33-30.607 34.475-34.247 77.028-55.978 120.377-76.003 67.926-31.403 137.785-58.027 211.286-73.273 34.02-7.054 68.835-11.605 103.537-14.222 41.416-3.072 83.058-4.665 124.473-3.641 53.817 1.251 106.838 8.42 155.99 33.11 26.51 13.311 48.697 31.743 53.475 62.008 3.3 21.163 2.048 43.577-0.341 65.08-3.982 36.524-18.887 70.202-33.45 103.425-3.87 8.76-13.995 15.815-22.756 20.935-22.187 12.97-46.99 19.684-72.135 24.462-70.884 13.54-140.402 7.51-208.214-16.839-40.277-14.45-72.704-40.732-102.286-70.883-3.072-3.072-5.575-7.282-9.33-9.103-3.982-1.934-10.354-3.527-13.198-1.593-2.958 2.048-4.665 8.761-3.868 12.744 1.024 4.778 4.664 9.557 8.192 13.312 42.894 46.42 95.118 77.482 156.672 91.704 73.5 16.953 146.66 16.043 218.794-7.85a122.643 122.643 0 0 0 12.174-4.779c3.869-1.707 7.737-3.868 13.085-4.779-7.965 11.606-15.474 23.439-23.78 34.703-55.978 75.093-127.772 127.886-218.34 154.282-57.798 16.84-115.597 14.45-173.055 0.455-96.029-23.438-184.206-63.715-260.21-128.113-23.666-20.025-45.966-41.643-61.554-68.836-6.03-10.467-11.15-21.845-13.994-33.337-2.39-9.216-6.144-15.132-14.109-17.522z m699.05-229.376c-11.15 1.024-22.413 1.48-33.45 3.186-17.067 2.73-33.337 8.306-46.876 19.456-11.947 9.785-10.582 23.894 2.73 31.403 5.348 2.958 11.378 5.12 17.295 6.713 26.965 7.395 54.5 5.461 81.806 2.39 13.994-1.594 27.875-6.031 41.074-11.151 9.102-3.527 15.928-11.264 15.473-22.414-0.455-10.582-9.102-14.45-16.839-18.091-19.342-8.875-40.05-11.378-61.212-11.492zM566.387 275.911c16.156 0 28.786-11.378 28.786-25.714-0.114-14.222-13.312-26.055-28.9-25.941-16.27 0.114-28.444 11.264-28.558 25.941 0 14.336 12.515 25.6 28.672 25.714z m125.27 619.748c-7.51 0-14.678 0.455-21.732-0.228-1.935-0.227-4.552-3.527-5.12-5.916-5.234-20.48-9.672-41.302-15.36-61.668-2.162-7.964-6.258-15.701-10.923-22.642-7.054-10.581-18.887-11.946-26.852-2.048-7.737 9.558-14.563 20.367-19.342 31.744-6.94 16.612-11.947 34.02-16.839 51.428-2.048 7.168-4.551 10.923-12.516 9.671-4.437-0.683-9.216-0.114-14.79-0.114 1.137-29.81 2.161-58.71 3.299-90.226-7.054 3.528-12.402 5.234-16.498 8.42-9.443 7.623-18.773 15.474-27.307 24.12-15.473 15.816-30.492 32.2-45.51 48.584-9.444 10.24-12.744 11.264-29.014 7.51a27062.731 27062.731 0 0 1 58.027-98.077c-18.887-5.461-35.385-12.97-42.44-32.313-4.437-12.06-3.754-24.007 1.138-36.409 1.138 4.21 2.048 8.533 3.3 12.743 6.371 21.732 25.486 32.996 46.99 26.51 5.575-1.706 11.72-6.371 14.791-11.264 18.887-30.492 37.092-61.44 55.069-92.387 3.3-5.689 6.599-6.713 12.743-5.689 29.582 4.665 59.278 9.102 89.088 1.252 6.485-1.707 12.743-4.438 19.683-6.94 0.114 80.895 0.114 161.677 0.114 243.939z"
                            fill="#8a8a8a" p-id="4923"></path>
                    </svg></div>
                <div style="margin-top: -5px;font-size:medium;font-size: 13px;">京东特卖</div>
            </a>
        </div>
    </div>

</body>

<script src="https://cdn.jsdelivr.net/gh/clin003/cdn/openapi_weblive/live/static/js/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/clin003/cdn/openapi_weblive/live/static/js/axios.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/clin003/cdn/openapi_weblive/live/static/js/clipboard.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/clin003/cdn/openapi_weblive/live/static/js/d-toast.min.js"
    charset="UTF-8"></script>

<script>
    new Vue({
        el: ".container",
        mounted: function () {
            var _this = this
            axios.get(
                'https:\/\/api.lyhuilin.com/ws/feedMsgList',
            ).then(
                function (res) {
                    if (res.data.code == 0) {
                        var jsonArray = res.data.data;
                        _this.msgList = jsonArray;
                    }
                }
            );
            this.ws = new WebSocket("wss:\/\/api.lyhuilin.com/ws/live/abc")
            this.ws.onopen = function () {
                console.log("连接成功")
            }
            this.ws.onmessage = function (ev) {
                var item = JSON.parse(ev.data)
                _this.msgList.splice(0, 0, item);
                showPushMsg("新消息⏰", item.text.content)
            }
            window.addEventListener('scroll', this.handleScroll)
        },
        destroy: function () {
            document.removeEventListener('scroll', this.handleScroll)
            document.body.scrollTop = document.documentElement.scrollTop = 0
        },
        data: {
            ws: null,
            nickName: "",
            msgList: [],
            content: "",
            isShowimg: false,
        },
        methods: {
            copyMessage(e, text) {
                const clipboard = new ClipboardJS(e.target, { text: () => text })
                clipboard.on('success', e => {
                    console.log('复制成功');
                    clipboard.off('error')
                    clipboard.off('success')
                    clipboard.destroy()
                    showTipsMsg('👌成功复制✌️', 2000)
                })
                clipboard.on('error', e => {
                    console.log('手机权限不支持复制功能');
                    clipboard.off('error')
                    clipboard.off('success')
                    clipboard.destroy()
                    showTipsMsg('❌手机权限不支持复制功能', 2000)
                })
                clipboard.onClick(e)
            },
            goTop() {
                document.body.scrollTop = document.documentElement.scrollTop = 0
                this.isShowimg = false
            },
            handleScroll(e) {
                let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
                let offsetTop = 0
                try {
                    offsetTop = document.querySelector('.main').offsetTop
                } catch (e) {
                    offsetTop = 0
                }
                if (scrollTop > offsetTop) {
                    if (scrollTop > 500) {
                        this.isShowimg = true
                    } else {
                        this.isShowimg = false
                    }
                } else {
                    this.isShowimg = false
                }
            },
        }
    })
</script>

<script type="text/javascript">
    function showPushMsg(title, msg) {
        var config = {
            title: title,
            body: msg,
        }
        new dToast(config);
    };
</script>

<script>
    function showTipsMsg(msg, duration) {
        duration = isNaN(duration) ? 3000 : duration;
        var m = document.createElement('div');
        m.innerHTML = msg;
        m.style.cssText = "max-width:60%;min-width: 150px;padding:0 14px;height: 40px;color: rgb(255, 255, 255);line-height: 40px;text-align: center;border-radius: 4px;position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: 999999;background: rgba(0, 0, 0,.7);font-size: 16px;";
        document.body.appendChild(m);
        setTimeout(function () {
            var d = 0.5;
            m.style.webkitTransition = '-webkit-transform ' + d + 's ease-in, opacity ' + d + 's ease-in';
            m.style.opacity = '0';
            setTimeout(function () { document.body.removeChild(m) }, d * 1000);
        }, duration);
    }
</script>

</html>